package com.jack.student;

import java.util.Scanner;

public class SelectInfo {


    public static void select(){
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入你要查询的学号:");
        long num = scanner.nextLong();
        for(StudentInfo lis:AddInfo.students){
            if(lis.getStuId() == num){
                System.out.println("学号:"+lis.getStuId()+" 姓名:"+lis.getStuName()+"  年龄:"+lis.getAge()+"  性别:"+lis.getSex()+"  电话:"+lis.getIphoneNum()+"  班级:"+lis.getClassRoom());
                break;
            }else if(lis.getStuId() == AddInfo.students.get(AddInfo.students.size()-1).getStuId()){
                System.out.println("你输入的学号不存在,请从新输入:");
            }
        }
    }

    public static void selectAll(){
        System.out.println("学号"+"\t\t"+"姓名"+"\t\t"+"年龄"+"\t\t"+"性别"+"\t\t"+"电话"+"\t\t"+"班级");
        for (StudentInfo lis:AddInfo.students){
            System.out.println(lis.getStuId()+"\t\t"+lis.getStuName()+"\t\t"+ lis.getAge()+"\t\t"+lis.getSex()+"\t\t"+lis.getIphoneNum()+"\t\t"+lis.getClassRoom());
        }
    }
}
